package com.ymkj.testdemo.controller;

import com.ymkj.testdemo.annotation.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import service.HelloService;

import java.util.ArrayList;
import java.util.List;

@RestController
public class HelloController {

    @Autowired
    private HelloService helloService;


    @RequestMapping("/hello")
    public String hello(@RequestParam String name){
        //return "hello:"+name;
        return helloService.sayHello();
    }

    @RequestMapping("/")
    @Test("测试")
    public List<String> getById() {
        System.err.println("o+++++++++++++++++");
        List<String> list=new ArrayList<String>();
        list.add("1");
        list.add("qwe");
        list.add("asd");
        return list;
    }

}
